|
|
> I think you are confusing "string" and "stream" above. They are two
> quite different things... :)
Yes, it was a mistake: writing "stream" for "string" (see my answer
to Thorsten that I posted 3 minutes before your message :-p )
> I was talking about std::string.
> Almost *any* operation on a std::string is faster than an equivalent
> operation on a C string. The simplest example is getting the size
> of the string.
> std::string::size() is a constant-time operation (it simply returns
> the value of a variable)
This example is very trivial, and you can easily implement the same
in your own string library in C. What I'd like to see is the performance of
creating a dynamical formatted string, similarly to vsprintf() -- but of course
without the static buffer passed as argument, which makes vsnprintf unecessary.
> (If you do it wrong and you want to change it, you'll have to go
> through the millions of lines and change every place where it's
> used... Remember y2k?-) )
'sed' ;-)
- NC
Post a reply to this message
|
|